# Definition for a binary tree node.
class TreeNode:
    def __init__(self, x):
        self.val = x
        self.left = None
        self.right = None


class Solution:
    def maxDepth(self, root: TreeNode) -> int:
        if root is None:
            return 0
        left = self.maxDepth(root.left)
        right = self.maxDepth(root.right) + 1
        return max(left, right) + 1


if __name__ == '__main__':
    so = Solution()
    root = TreeNode(1)
    root.left = TreeNode(0)
    r = so.zigzagLevelOrder(root)
    print(r)
